package cn.foolishbird.hamal.frame.exception;

import cn.foolishbird.hamal.frame.bsassert.info.RstInfo;

/**
 * 解决 BaseException 和其他类型耦合问题
 *
 * @author Eric
 * @version 1.0
 * @date 2020-01-09
 */
public class ExceptionFactory {

    /**
     * 将错误码转换成错误抛出
     *
     * @param info
     * @return com.eastech.cargame.common.exception.BusinessException
     * @throws
     * @author Eric
     * @date 2020/1/9
     **/
    public static BusinessException businessException(RstInfo info) {
        return new BusinessException(info.code(), info.content(), info.data());
    }

}
